//
//  Factory.m
//  OC1_类和对象课后作业
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Factory.h"

@implementation Factory

-(id)init
{

    _name = @"造船厂";
    _number = 98756;
    [self info];
    return self;

}

-(void)info
{

    NSLog(@"%@ %ld", _name, _number);

}

-(void)fire
{

    NSLog(@"%@决定开除%ld名员工", _name, _number);

}

-(id)initWithName:(NSString *)name number:(NSInteger)number
{
    _name = name;
    _number = number;
    return self;
  
}


-(NSString *)name
{
    return _name;
}

-(void)setName:(NSString *)name
{
    _name = name;
}
-(NSInteger)number
{
    return _number;
}
-(void)setNumber:(NSInteger)number
{
    _number = number;
}

+ (id)factoryWithName:(NSString *)name number:(NSInteger)number
{
    Factory *f = [[Factory alloc] initWithName:name number:number];
    return f;
}


@end
